<?php
$this->breadcrumbs=array(
	'Articles',
);

$this->menu=array(
	array('label'=>'Create Article', 'url'=>array('create')),
	array('label'=>'Manage Article', 'url'=>array('admin')),
);


?>
<script language="javascript">
$(function(){

	$("#product-statistics").css({"height":"120px","overflow":"hidden"});
	
	$("#product-show").toggle(function(){
		$("#product-statistics").css({"height":"auto"}).fadeIn('show');
	},function(){
		$("#product-statistics").css({"height":"120px","overflow":"hidden"});
	});
	
	$("input[type=checkbox]").click(function(){
		alert($(this).val());
	});

	$(".achiveremove").click(function(){
		var href = $(this).attr("href");
		var object = $(this);
		$.post(href,function(data){
			if(data == 'ok'){
				object.parent().parent().parent().slideUp();
			}
		});
		return false;
	});
	

	
	$(".achiveview").hover(function(){
		$(this).find(".achive-action").show();
	},function(){
		$(this).find(".achive-action").hide();
	});
});
</script>

<div class="column1 colborder">
<div class="box">
	<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>'News Statistics',	));?>
		
			<div>文章 (<?php echo CHtml::link($statistics['total'],array('list'));?>) |页面 (<?php $page = Article::model()->getNewsStatistics(Category::CONTENT_PAGE); echo CHtml::link($page['total'],array('news/list','ctype'=>Category::CONTENT_PAGE));?>) |    已发布 (<?php echo CHtml::link($statistics['published'],array('list','state'=>Article::STATUS_PUBLISHED));?>) |   锁定(<?php echo CHtml::link($statistics['lock'],array('list','state'=>Article::STATUS_LOCK));?>) |    草稿 (<?php echo CHtml::link($statistics['draft'],array('list','state'=>Article::STATUS_DRIFT));?>) | 存档文件(<?php echo CHtml::link($statistics['achive'],array('achive'));?>) | 回收站 (<?php echo CHtml::link($statistics['lock'],array('list','state'=>Article::STATUS_TRASH));?>)	</div>
			<div class="box-content">
				<ul id="product-statistics">
				<?php foreach ($catelist as $cate):?>
					<?php $this->renderPartial('_list',array('data'=>$cate));?>
				<?php endforeach;?>		
				</ul>
				<div style="text-align: right;"><a id="product-show" href="javascript:void();">显示所有分类</a></div>
			</div>
			
	<?php $this->endWidget();?>
</div>
<div class="box">
	<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>'Achives',	));?>
		<div class="box-content">
			<?php foreach ($achive as $data): ?>
				<?php $this->renderPartial('_achiveview',array('data'=>$data));?>
			<?php endforeach;?>
		</div>	
	<?php $this->endWidget();?>
</div>
</div>
<div class="column2">
<div class="box">
	<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>'News Lists',	));?>
 		<div class="box-content">
			<?php $this->widget('application.components.latest.Latest',array(
					'limit'=>5,
					'timeFormat'=>'Y-m-d h:i:s',
					'htmlOptions'=>array(
						'style'=>"text-align:center;"
					)
			));?> 		
 		</div>
	<?php $this->endWidget();?>
</div>	
</div>

<?php $this->widget('ext.box.colorbox.colorboxWidget',array(
		'id'=>'td a',
		'options'=>'width:"95%", height:"95%", iframe:true'
))?>
